package com.nbcio.demo.domain.bo;

import com.nbcio.demo.domain.TestOrderMain;
import com.nbcio.common.mybatis.core.domain.BaseEntity;
import com.nbcio.common.core.validate.AddGroup;
import com.nbcio.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableField;
import com.nbcio.demo.domain.TestOrderGoods;

/**
 * 订单主表业务对象 test_order_main
 *
 * @author nbacheng
 * @date 2025-04-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = TestOrderMain.class, reverseConvertGenerate = false)
public class TestOrderMainBo extends BaseEntity {

    /**
     * 主键
     */
            @NotNull(message = "主键不能为空", groups = { EditGroup.class })
        private Long id;
    /**
     * 订单编码
     */
            @NotBlank(message = "订单编码不能为空", groups = { AddGroup.class, EditGroup.class })
        private String orderCode;
    /**
     * 客户编号
     */
            @NotNull(message = "客户编号不能为空", groups = { AddGroup.class, EditGroup.class })
        private Long customerId;
    /**
     * 下单时间
     */
            @NotNull(message = "下单时间不能为空", groups = { AddGroup.class, EditGroup.class })
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        private Date xdDate;
    /**
     * 订单总额
     */
            @NotNull(message = "订单总额不能为空", groups = { AddGroup.class, EditGroup.class })
        private BigDecimal money;
    /**
     * 备注
     */
        private String remark;
    /** 订单子表信息 */
    @TableField(exist = false) // 添加此注解
    private List<TestOrderGoods> testOrderGoodsList;
}
